"use strict";
var chai = require('chai');
var co = require('co');
var moment = require('moment');
var expect = chai.expect;
var q = require('q');
var models = require('../models/index.js');
var TpsHelper = require('../service/TpsHelper');


describe('TpsHelper测试', function () {
    this.timeout(1000 * 60);
    it.skip('#能够正确的获取当前的最大测回数', function () {
        return co(function* () {
            var tps = new TpsHelper({});
            var number = yield tps._getMaxNo();
            console.log('\t最大测回数是:', number);
            expect(number).to.be.equal(0);
        });
    });

    it('#能够正确的开始全站仪测量,并把数据保存', function (done) {
        co(function* () {
            var tps = new TpsHelper({});
            tps.on('tpssurveystart', function () {
                console.log('\t全站仪开始测量');
            });
            tps.startSurvey();
            setTimeout(function () {
                tps.stopSurvey();
            }, 1000 * 10);
            tps.on('tpssurveystop', function () {
                console.log('\t全站仪结束测量');
                done();
            });
        });
    });
});